package views;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

import testcases.LoginProcess;

import com.thoughtworks.selenium.HttpCommandProcessor;
import com.unitedinternet.portal.selenium.utils.logging.LoggingDefaultSelenium;

public class MainForm extends JFrame {

	static JButton btnNext;
	static JLabel label1, label2;
	static JRadioButton smoke, regression;

	public static JPanel formLayout() {
		JPanel form = new JPanel();
		try {
			label1 = new JLabel();
			label1.setName("Select the type of Test to be performed:");
			smoke = new JRadioButton("Smoke Test");
			smoke.setSelected(true);
			regression = new JRadioButton("Regression Test");
			ButtonGroup group = new ButtonGroup();
			group.add(smoke);
			group.add(regression);
			JPanel radiopanel1 = new JPanel();
			radiopanel1.add(smoke);
			radiopanel1.add(regression);
			radiopanel1.add(label1);

			form.add(radiopanel1);
			btnNext = new JButton("Next");
			form.add(btnNext);

			LoggingDefaultSelenium selenium = new LoggingDefaultSelenium(
					new HttpCommandProcessor("localhost", 4444, "*chrome",
							"https://www.ebuying-services.com"));
			selenium.start();
			selenium.open("/");
			selenium.windowMaximize();
			
			LoginProcess.validLogin(selenium);
			

		} catch (Exception e) {
			throw new RuntimeException(e);
		}
		return form;
	}

}
